using System;
using System.Collections;
using System.Data;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.XPath;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using CSP.MembershipInterface;

namespace CSP.WebParts
{
    /// <summary>
    /// Case details
    /// </summary>
    [Guid("0DCBA688-EDFE-4c0d-A178-EFDEFB692ABD")]
    public class CSPCaseDetails : BaseWebPart
    {
       
        #region events
        /// <summary>
        /// Constructor
        /// </summary>
        public CSPCaseDetails()
        {
            this.ExportMode = WebPartExportMode.All;
        }


        /// <summary>
        /// Fired on page create child control, loads the ASCX file
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            try
            {
                UserControls.CSPCaseDetailWUC control = (UserControls.CSPCaseDetailWUC)Page.LoadControl(WebPartConstants.CSPCaseDetailWUC);
                control.WrapperWebPart = this;
                this.Controls.Add(control);

            }
            catch (CSP.Core.CSPException cspex)
            {
                errors.Add(this.LoadResource(WebPartConstants.CSPGenericErrorMessage));
            }

            catch (Exception ex)
            {
                this.LogMessage(this.LoadResource(WebPartConstants.CSPLoadControlErrorMessage), this.GetType().Name, ex);
                errors.Add(this.LoadResource(WebPartConstants.CSPGenericErrorMessage));
            }
        }
        #endregion

    }
}
